/*
路由对象模块
*/
// 引入vue
import Vue from 'vue'
// 引入路由
import VueRouter from 'vue-router'

// 引入需要注册的路由
import Shouye from '../views/ShouYe/ShouYe.vue'
import Miquan from '../views/Miquan/Miquan.vue'
import Fenlei from '../views/FenLei/FenLei.vue'
import Gouwuche from '../views/Gouwuche/Gouwuche.vue'
import Wode from '../views/Wode/Wode.vue'
import detail from '../views/detail/detail.vue'

import guanzhu from '../views/Miquan/guanzhu/guanzhu.vue'
import sheying from '../views/Miquan/sheying/sheying.vue'
import tuijian from '../views/Miquan/tuijian/tuijian.vue'
import xiaomiCi from '../views/Miquan/xiaomiCi/xiaomiCi.vue'


const routerReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function (location) {
    return routerReplace.call(this, location).catch(error => error)
}
// 声明使用vue-router
Vue.use(VueRouter)

let x = new VueRouter({
    mode: 'history',
    routes: [
        {
            path: '/shouye',
            name: 'shouye',
            component: Shouye,
            meta: {
                isShow: true,
            }
        },
        {
            path: '/detail',
            name: 'detail',
            component: detail,
            
        },
        {
            path: '/fenlei',
            name: 'fenlei',
            component: Fenlei,
            meta: {
                isShow: true,
            }
        },
        {
            path: '/sheying',
            name: 'sheying',
            component: sheying,
        },
        {
            path: '/miquan',
            name: 'miquan',
            component: Miquan,
            meta: {
                isShow: true,
            },
            children:[
                {
                    path: 'guanzhu',
                    name: 'guanzhu',
                    component: guanzhu,
                },
                
                {
                    path: 'tuijian',
                    name: 'tuijian',
                    component: tuijian,
                },
                {
                    path: 'xiaomiCi',
                    name: 'xiaomiCi',
                    component: xiaomiCi,
                },
                {
                    path: '/miquan',
                    redirect: '/miquan/tuijian',
                },
            ]
        },
        {
            path: '/gouwuche',
            name: 'gouwuche',
            component: Gouwuche,
            meta: {
                isShow: true,
            }
        },
        {
            path: '/wode',
            name: 'wode',
            component: Wode,
            meta: {
                isShow: true,
            }
        },
        {
            path: '/',
            redirect:'/shouye',
        },
        
    ]
})
export default x